<script language="javascript">
function showhideMultiLev(thecell,noChild){
	if (noChild==1) return true;
	if (eval('document.all.'+thecell).style.display!=''){
		eval('document.all.'+thecell).style.display = '';
	}else{
		eval('document.all.'+thecell).style.display = 'none';
	}
	return false;
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                     <!--<tr>
                        <td class="style17">Danh mục sản phẩm</td>
                      </tr>
					 -->
                      
<?
$catinfo = getRecord("tbl_product_category", "id=" . $cat);
$parentCode = $_lang == 'vn' ? 'vn' : 'en';
$sqlParent = "select * from tbl_product_category where status=0 and parent=(select id from tbl_product_category where code='" .
    $parentCode . "') order by sort, date_added";
$resultParent = mysql_query($sqlParent, $conn);
while ($rowParent = mysql_fetch_assoc($resultParent)) {
    $isHaveChild = isHaveChild("tbl_product_category", $rowParent['id']) ? 0 : 1;
?>
	<tr>
			<td class="style15"><?= $rowParent['name'] ?></td>
	</tr>
<?
    if ($_REQUEST['frame'] == 'product_detail') {

        $catinfo = getRecord("tbl_product_category",
            "id = (select parent from tbl_product where id=" . $_REQUEST['id'] . ")");

    }
?>
	<tr id="menu_cat<?= $rowParent['id'] ?>" <?= $catinfo['parent'] != $rowParent['id'] ?
'style="display: "' : '' ?>>
	  <td><table width="100%" border="0" cellspacing="0" cellpadding="0">

<?
    $sqlChild = "select * from tbl_product_category where status=0 and parent='" . $rowParent['id'] .
        "' order by sort, date_added";
    $resultChild = mysql_query($sqlChild, $conn);
    while ($rowChild = mysql_fetch_assoc($resultChild)) {
?>				
<tr>
<td class="style16">
			<a title="khohangtot| do gia dung" href="./?frame=product&cat=<?= $rowChild['id'] ?>" class="link7">
				 <?= $rowChild['name'] ?></a>
				  </td>
				</tr>
<? } ?>
	</table>
		</td>
	</tr>
<? } ?>
</table>